2023-10-19


Classes - Public, private, protected
In classes you can have public, private or protected properties/methods.
Public means that it is public, you can edit it from outside the class.
Private means that it is private, you can’t edit it from outside the class.
Protected means that it is protected, you can’t edit it from outside the class except if it’s in a derived sub class.
Normally you add underscores in front of private/protected properties and use getters/setters to interact with them instead.
Go back to all posts